<template>
	<view class="page">
		<view class='bg-grey'>
			<view class="conf-list">
				<view class="conf-list-item" v-for="(item,index) in listData" :key="index">
					<view class="conf-list-card">
						<view class="conf-list-title">
							<view>
								<text>工序：</text>
								{{item.operationName==null?'':item.operationName}}
							</view>
							<view>
								<text>部件：</text>
								<text>{{item.buweiName==null?'':item.buweiName}}</text>
							</view>
						</view>
						
						<view class="conf-list-content1">
							<view>
								<text>尺码：</text>
								<text>{{item.size==null?'':item.size}}</text>
							</view>
							<view>
								<text>尺码派工数：</text>
								{{item.quantity==null?'':item.quantity}}
							</view>
						</view>
						<view class="conf-list-content1">
							<view>
								<text>人员：</text>
								<text>{{item.workerName==null?'':item.workerName}}</text>
							</view>
							<view>
								<text>人员派工数：</text>
								<text>{{item. bujianQuantity==null?'':item. bujianQuantity}}</text>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex'
	export default {
		computed: {
			...mapState(['companyCode'])
		},
		data() {
			return {
				dateList:'全部',
				workList: '进行中',
				text: '暂无数据',
				title: '下拉刷新 + 加载更多',
				data: [],
				listData: [],
				pageNo: 0,
				endFlag: false,
				filter: "",
				dispatchNo:'',
				loadMoreText: "加载中...",
			};
		},

		onShow() {
			this.loadMoreText = "加载更多";
		},
		onLoad(e) {
			this.initData();
			let detail = JSON.parse(decodeURIComponent(e.info));
			this.dispatchNo = detail.dispatchNo
			console.log(detail)
		},
		mounted(){
		},
		onUnload() {
			this.listData = [];
		},
		onReachBottom() {
			if (this.endFlag == true) {
				this.loadMoreText = "已显示全部数据"
				uni.showToast({
					icon: 'none',
					title: this.loadMoreText
				});
				return;
			}
			setTimeout(() => {
				this.listData = []
				this.getList()
			}, 300);
		},
		onPullDownRefresh() {
			uni.stopPullDownRefresh();
		},
		methods: {
			initData() {
				setTimeout(() => {
					this.getList();
					uni.stopPullDownRefresh();
				}, 300);
			},
           //产品列表
			getList() {
				this.listData=[]
				let url = '/dcloud/dcDispatchOrder/dcDispatchOrder/getDcDispatchItemAndBujian'
				this.pageNo+=1
				this.$http.get(url, {
					params: {
						'dispatchNo':this.dispatchNo
					}
				}).then(res => {
					if (res.data.success) {
						this.listData=res.data.result;
						if (this.listData.length <100) {
							this.endFlag = true;
							this.loadMoreText = "已显示全部数据"
						}
					}
				}).catch(err => {
					console.log(err);
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	::v-deep .uni-select {
		font-size: 14px;
		border: 0px solid #dd524d;
		box-sizing: border-box;
		border-radius: 0px;
		padding: 0 5px;
		padding-left: 10px;
		position: relative;
		display: flex;
		-webkit-user-select: none;
		user-select: none;
		flex-direction: row;
		align-items: center;
		border-left: solid 1px #e5e5e5;
		width: 100%;
		flex: 1;
		height: 50upx;
	}

	::v-deep .uni-stat__actived {
		width: 150rpx;
		flex: 1;
	}

	page {
		background: #FFFFFF;
		width: 750upx;
		overflow-x: hidden;
	}
	.bg-grey {
		background-color: rgb(234, 231, 231);
		padding: 2upx 20upx;

		.time-flex {
			display: flex;
			flex-wrap: wrap;

			.time-flex-item {
				width: 50%;
				text-align: center;
				height: 100upx;
				padding: 10upx 30upx;

				.time-flex-item-padding {
					background: #FFFFFF;
					height: 80upx;
					color: black;
					border-radius: 14upx;
					line-height: 80upx;
				}
				.time-flex-item-padding:active {
						background-color: #f5f5f5;
					}
			}
		}

		.conf-list {
			margin-top: -10upx;
			.conf-list-item {
				height: 220upx;
				background: #FFFFFF;
				color: black;
				border-radius: 20upx;

				.conf-list-card {
					height: 220upx;
					border-radius: 20upx;
					margin-top: 20upx;

					.conf-list-title {
						height: 60upx;
						display: flex;
						padding: 6upx 20upx 10upx 20upx;
						justify-content: space-between;
						border-radius: 20upx 20upx 0upx 0upx;
						border-bottom: solid 1px #e5e5e5;
						font-size: 30upx;
					}

					.conf-list-content {
						height: 60upx;
						padding: 0 20upx;
						font-size: 26upx;
					}

					.conf-list-content1 {
						height: 80upx;
						padding: 10upx 20upx;
						font-size: 26upx;
						display: flex;
						justify-content: space-between;
						view{
							font-size: 26upx;
						}
					}
				}
			}
		}
	}
</style>
